package com.yld.scott.ch12;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class AA {
	
	
	public static void main(String[] args) {
		
		
		//输出流
		String aa = "中国";
		
		//1 派侦查兵  相对目录
		File file = new File("src/main/resources/add.txt");
		
		//字节流  CTRL+SHIF+T 查看源代码 jar
		
		FileOutputStream  fos = null;
		try {
			fos  = new FileOutputStream(file) ;
			
			
			
			fos.write(aa.getBytes());
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			
			if(fos != null){
				try {
					fos.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			
		}
		
		
	}

}
